package op.valorantwikibackend.controller;

import op.valorantwikibackend.model.Skin;
import op.valorantwikibackend.repository.SkinRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/api/skins")
public class SkinController {
    @Autowired
    private SkinRepository skinRepository;

    @GetMapping
    public List<Skin> getAllSkins() {
        return skinRepository.findAll();
    }

    @PostMapping
    public Skin createSkin(@RequestBody Skin skin) {
        return skinRepository.save(skin);
    }
}